#pragma once

#include <CGraph.h>
#include <CIniFile.h>
#include <string>
#include <CParameters.h>
#include <CLikelihood.h>

class CEstimator {
 public:
  CGraph dataTemplate, dataTemplateOrg, dataAbsorption;
  CGraph absorptionLines;
  vector<CGraph> data;
  
  bool use_absorption_lines;

  int cutoff_mode_start, cutoff_mode_end;

  int cutoff_start_smallscale;
  string basename; // data base name
  CParameters params;

  CIniFile ini;

  void Setup(string filename);
  void Run();

  void CalculateChisq2D(string file, CGraph& g);
  void CalculateChisq1D(CGraph& g, double zfrom, double zto, double steps);
  void CalculateChisq1D();
  void CalculateChisq2D();
 private:
  void setupAbsorption();
  void CalculateSmooth();

};
